﻿@model ChurchEdu.Models.EditCategory

@{
    ViewBag.Title = "Edit";
}

<script type="text/javascript">

    function click_a(){

        document.getElementById("submenu").style.display = "";
    }
</script>

<style>
    fieldset .single-line, fieldset #submenuname {
        padding-left: 4px;
    }
</style>

@using (Html.BeginForm("EditComfirm", "Category", FormMethod.Post, new { @class = "" }))
{
    @Html.ValidationSummary(true)

    <fieldset>

        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.parentid)
        <div class="form-group">
                @Html.LabelFor(model => model.CategoryName) &emsp;
                @Html.EditorFor(model => model.CategoryName)
                @Html.ValidationMessageFor(model => model.CategoryName)
        </div>
        <p>
            <input type="submit" value="保存" class="button button-raised button-pill button-inverse button-small" style="vertical-align:2px;" /> &emsp;
            @Html.ActionLink("删除", "DeleteCategory", new { ID = Model.ID }, new { onclick = "return (confirm('确定要删除吗？该菜单的子菜单也将一起删除！'))" })
    
            &emsp;<a href="javascript:void(0)" onclick="click_a();">新增子菜单</a>
        </p>

    </fieldset>
}
        <div id="submenu" style="display: none">
     @using (Html.BeginForm("CreateSubmenu", "Category"))
     {
    @Html.ValidationSummary(true)
    <fieldset style="padding-top:20px;">
        <div class="form-group">
            名称 &emsp;
            @Html.TextBox("submenuname")
        </div>
        @Html.Hidden("ID",Model.ID)
        <p>
            <input type="submit" value="添加" class="button button-raised button-pill button-inverse button-small" />
        </p>
    </fieldset>
}

        </div>




